package com.ymttest.database.sqlwapper.sqdistributor;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.sqdistributor.DistributionAgencyCommisionRate;

public class DistributionAgencyCommisionRateWrapper {
	
	SqlManager manager;

	public DistributionAgencyCommisionRateWrapper() {
		manager = new SqlManager("sqdistributor");
	}

	@SuppressWarnings("unchecked")
	public DistributionAgencyCommisionRate selectByPrimaryKey(Long id) {

		DistributionAgencyCommisionRate distributionAgencyCommisionRate = null;
		List<DistributionAgencyCommisionRate> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqdistributor.DistributionAgencyCommisionRateMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() > 0) {
			distributionAgencyCommisionRate = result.get(0);
		}

		return distributionAgencyCommisionRate;
	}
	
	@SuppressWarnings("unchecked")
	public DistributionAgencyCommisionRate selectByConfigId(Long configId) {

		DistributionAgencyCommisionRate distributionAgencyCommisionRate = null;
		List<DistributionAgencyCommisionRate> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqdistributor.DistributionAgencyCommisionRateMapper.selectByConfigId",
						configId);
		manager.commit();

		if (result.size() > 0) {
			distributionAgencyCommisionRate = result.get(0);
		}

		return distributionAgencyCommisionRate;
	}
	
	public static void main(String[] args) {
		
		DistributionAgencyCommisionRateWrapper test = new DistributionAgencyCommisionRateWrapper();

		System.out.println(test.selectByConfigId(1L).getDistributor_level_label());
	}
}
